<%--
  Created by IntelliJ IDEA.
  User: MGL
  Date: 2020/10/12
  Time: 14:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>角色人员列表</title>
    <link rel="stylesheet" type="text/css" href="../css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href=../css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 部门中心 <span class="c-gray en">&gt;</span> 部门管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form action="../getAuthorization/getRoleEmp" method="post">
        <div class="text-c">
            人员名称：
            <input type="text" name="name" id="empSearch" class="input-text Wdate" style="width:120px;" value="${name}">
            <button type="submit" class="btn btn-success radius" id="" name="">搜索</button>
        </div>
    </form>
</div>
<div class="cl pd-5 bg-1 bk-gray mt-20">
    <span class="l">
        <input type="hidden" name="roleId" id="roleId" class="input-text Wdate" style="width:120px;" value="${roleId}">
        <a  href="javascript:;" onclick="authorizationUserRole()" class="btn btn-danger radius">
            <i class="Hui-iconfont">
                &#xe6e2;
            </i>
            批量授权
        </a>
    </span>
</div>
<div class="mt-20">
    <table class="table table-border table-bordered table-hover table-bg table-sort">
        <thead>
        <tr class="text-c" scope="col" colspan="9">
            <td></td>
            <th width="80">ID</th>
            <th width="100">用户名</th>
            <th width="40">性别</th>
            <th width="90">手机</th>
            <th width="150">邮箱</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${empList}" var="empList">
            <tr class="text-c">
                <td><input class="empId" type="checkbox" value="${empList.id}"></td>
                <td>${empList.id}</td>
                <td>${empList.userName}</td>
                <td>${empList.sexStr}</td>
                <td>${empList.mobile}</td>
                <td>${empList.email}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="../js/H-ui.min.js"></script>
<script type="text/javascript" src="../js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    function authorizationUserRole() {

        var roleId="${roleId}"
        var eleArray=$(".empId:checked")

        var empIdArray=new Array();

        for(var i=0;i<eleArray.length;i++){
            empIdArray.push(eleArray[i].value)
        }

        var param=new Object();
        param.roleId=roleId;
        param.empIdArray=empIdArray;


        $.post("getAuthorizationUserRole",param,function (data) {
            layer_close()
        });

    }
</script>
</body>
</html>
